﻿namespace gixoom.Dom.Score
{
    public interface IScoreFacade
    {
        /// <summary>
        /// Creates score object from the specified content.
        /// </summary>
        /// <param name="content">the content to create the score object for</param>
        /// <returns>created score object</returns>
        /// <exception cref="System.ArgumentNullException"><i>content</i> is a null reference.</exception>
        IScore CreateScoreFromContent(byte[] content);

        /// <summary>
        /// Creates score object from the specified range of the specified array.
        /// </summary>
        /// <param name="content">the input to create score object for</param>
        /// <param name="offset">the offset into the byte array from which to begin using data</param>
        /// <param name="count">the number of bytes in the array to use as data</param>
        /// <returns>created score object</returns>
        /// <exception cref="System.ArgumentNullException"><i>content</i> is a null reference.</exception>
        /// <exception cref="System.ArgumentOutOfRangeException"><i>offset</i> is out of range.
        /// This parameter requires a non-negative number which is less than the <i>content</i> length.</exception>
        /// <exception cref="System.ArgumentException"><i>count</i> is an invalid value or <i>content</i> length 
        /// is invalid.</exception>
        IScore CreateScoreFromContent(byte[] content, int offset, int count);

        /// <summary>
        /// Creates score object from the specified string.
        /// </summary>
        /// <param name="scoreString">score string</param>
        /// <returns>created score object</returns>
        /// <exception cref="System.ArgumentNullException"><i>scoreString</i> is a null reference.</exception>
        /// <exception cref="System.ArgumentException"><i>scoreString</i> is an empty string or
        /// it is invalid.</exception>
        IScore CreateScoreFromString(string scoreString);

        /// <summary>
        /// Creates score object from the specified array.
        /// </summary>
        /// <param name="bytes">the array to create score object from</param>
        /// <returns>created score object</returns>
        /// <exception cref="System.ArgumentNullException"><i>bytes</i> is a null reference.</exception>
        /// <exception cref="System.ArgumentException"><i>bytes</i> length is invalid.</exception>
        IScore CreateScoreFromBytes(byte[] bytes);

        /// <summary>
        /// Creates score object from the specified <i>bytes</i> array starting
        /// with the specified index.
        /// </summary>
        /// <param name="bytes">the input to create score object from</param>
        /// <param name="bytesIndex">the index in the array at which the bytes will be read</returns>
        /// <exception cref="System.ArgumentNullException"><i>bytes</i> is a null reference.</exception>
        /// <exception cref="System.ArgumentOutOfRangeException"><i>bytesIndex</i> doesn't fall into
        /// the <i>bytes</i> boundaries.</exception>
        /// <exception cref="System.ArgumentException"><i>bytes</i> length or <i>bytesIndex</i> is invalid.</exception>
        IScore CreateScoreFromBytes(byte[] bytes, int bytesIndex);

        /// <summary>
        /// Gets score size bytes.
        /// </summary>
        int ScoreSizeBytes
        {
            get;
        }
    }
}
